import {createBrowserRouter} from 'react-router-dom'
import App from '../App'
import RouteGuard from '../components/RouteGuard'

const router = createBrowserRouter([
    {
        path:'/',
        element:<App/>,
        children:[
            {
                path:'/index',
                
                lazy:async()=>{
                    const {default:Index} = await import('../pages/Index/Index')
                    return {
                        element:<Index/>
                    }
                }
            },
            {
                path:'/message',
                lazy:async()=>{
                    const {default:Message} = await import('../pages/Message/Index')
                    return {
                        element:<RouteGuard><Message/></RouteGuard>
                    }
                }
            },
            {
                path:'/order',
                lazy:async()=>{
                    const {default:Order} = await import('../pages/Order/Index')
                    return {
                        element:<Order/>
                    }
                }
            },
            {
                path:'/shopping',
                lazy:async()=>{
                    const {default:Shopping} = await import('../pages/Shopping/Index')
                    return {
                        element:<RouteGuard><Shopping/></RouteGuard>
                    }
                }
            },
            {
                path:'/Anli',
                lazy:async()=>{
                    const {default:Anli} = await import('../pages/Anli/Index')
                    return {
                        element:<RouteGuard><Anli/></RouteGuard>
                    }
                }
            }
        ],
    },
    {
        path:'/set',
        lazy:async()=>{
            const {default:Set} = await import('../pages/Set/Index')
            return {
                element:<Set/>
            }
        }
    },
    {
        path:'/login',
        lazy:async()=>{
            const {default:Login} = await import('../pages/Login/Index')
            return {
                element:<Login/>
            }
        }
    },
    {
        path:'/talkDoctor',
        lazy:async()=>{
            const {default:TalkDoctor} = await import('../pages/TalkDoctor/Index')
            return {
                element:<RouteGuard><TalkDoctor/></RouteGuard>
            }
        }
    },
    {
        path:'/ArtDetail/:id',
        lazy:async()=>{
            const {default:ArtDetail} = await import('../pages/ArtDetail/Index')
            return {
                element:<RouteGuard><ArtDetail/></RouteGuard>
            }
        }
    },
    {
        path:'/DoctorDetail/:id',
        lazy:async()=>{
            const {default:DoctorDetail} = await import('../pages/DoctorDetail/Index')
            return {
                element:<RouteGuard><DoctorDetail/></RouteGuard>
            }
        }
    },
    {
        path:'/MedicineDetail',
        lazy:async()=>{
            const {default:MedicineDetail} = await import('../pages/MedicineDetail/Index')
            return {
                element:<RouteGuard><MedicineDetail/></RouteGuard>
            }
        }
    },
    {
        path:'/Search',
        lazy:async()=>{
            const {default:Search} = await import('../pages/Search/Index')
            return {
                element:<RouteGuard><Search/></RouteGuard>
            }
        }
    },
    {
        path:'/YaoDetail',
        lazy:async()=>{
            const {default:YaoDetail} = await import('../pages/YaoDetail/Index')
            return {
                element:<RouteGuard><YaoDetail/></RouteGuard>
            }
        }
    },
    {
        path:'/Yuyue',
        lazy:async()=>{
            const {default:Yuyue} = await import('../pages/Yuyue/Index')
            return {
                element:<RouteGuard><Yuyue/></RouteGuard>
            }
        }
    },
    {
        path:'/SocoDetail/:id',
        lazy:async()=>{
            const {default:SocoDetail} = await import('../pages/SocoDetail/Index')
            return {
                element:<RouteGuard><SocoDetail/></RouteGuard>
            }
        }
    },
    {
        path:'/City',
        lazy:async()=>{
            const {default:City} = await import('../pages/City/Index')
            return {
                element:<RouteGuard><City/></RouteGuard>
            }
        }
    },
    {
        path:'/GuaSearch',
        lazy:async()=>{
            const {default:GuaSearch} = await import('../pages/Guasearch/Index')
            return {
                element:<RouteGuard><GuaSearch/></RouteGuard>
            }
        }
    },
    {
        path:'/Guahao',
        lazy:async()=>{
            const {default:Guahao} = await import('../pages/Guahao/Index')
            return {
                element:<RouteGuard><Guahao/></RouteGuard>
            }
        }
    },
    {
        path:'/Fuzhen',
        lazy:async()=>{
            const {default:Fuzhen} = await import('../pages/Fuzhen/Index')
            return {
                element:<RouteGuard><Fuzhen/></RouteGuard>
            }
        }
    },
    {
        path:'/OrderDetail/:id',
        lazy:async()=>{
            const {default:OrderDetail} = await import('../pages/OrderDetail/Index')
            return {
                element:<RouteGuard><OrderDetail/></RouteGuard>
            }
        }
    },
    {
        path:'/Teme',
        lazy:async()=>{
            const {default:Teme} = await import('../pages/Teme/Index')
            return {
                element:<RouteGuard><Teme/></RouteGuard>
            }
        }
    },
    {
        path:'/Wenzhen',
        lazy:async()=>{
            const {default:Wenzhen} = await import('../pages/Wenzhen/Index')
            return {
                element:<Wenzhen/>
            }
        }
    },
    {
        path:'/RiskDisclosure',
        lazy:async()=>{
            const {default:RiskDisclosure} = await import('../pages/RiskDisclosure/Index')
            return {
                element:<RouteGuard><RiskDisclosure/></RouteGuard>
            }
        }
    },
    {
        path:'/NewOrder',
        lazy:async()=>{
            const {default:NewOrder} = await import('../pages/NewOrder/Index')
            return {
                element:<RouteGuard><NewOrder/></RouteGuard>
            }
        }
    },
    {
        path:'/deng',
        lazy:async()=>{
            const {default:Deng} = await import('../pages/deng/Index')
            return {
                element:<Deng/>
            }
        }
    },
    {
        path:'/DoorNew',
        lazy:async()=>{
            const {default:DoorNew} = await import('../pages/DoorNew/Index')
            return {
                element:<RouteGuard><DoorNew/></RouteGuard>
            }
        }
    },
    {
        path:'/DoorDetail/:id',
        lazy:async()=>{
            const {default:DoorDetail} = await import('../pages/DoorDetail/Index')
            return {
                element:<RouteGuard><DoorDetail/></RouteGuard>
            }
        }
    },
    {
        path:'/DoorDetails/:id',
        lazy:async()=>{
            const {default:DoorDetails} = await import('../pages/DoorDetails/Index')
            return {
                element:<RouteGuard><DoorDetails/></RouteGuard>
            }
        }
    },
    {
        path:'/Houzhen',
        lazy:async()=>{
            const {default:Houzhen} = await import('../pages/Houzhen/Index')
            return {
                element:<RouteGuard><Houzhen/></RouteGuard>
            }
        }
    },
    {
        path:'/HouDetail',
        lazy:async()=>{
            const {default:HouDetail} = await import('../pages/HouDetail/Index')
            return {
                element:<RouteGuard><HouDetail/></RouteGuard>
            }
        }
    },
    {
        path:'/OpenOrder',
        lazy:async()=>{
            const {default:OpenOrder} = await import('../pages/OpenOrder/Index')
            return {
                element:<RouteGuard><OpenOrder/></RouteGuard>
            }
        }
    },
    {
        path:'/OpenTrue',
        lazy:async()=>{
            const {default:OpenTrue} = await import('../pages/OpenTrue/Index')
            return {
                element:<RouteGuard><OpenTrue/></RouteGuard>
            }
        }
    },
    {
        path:'/OpenLength',
        lazy:async()=>{
            const {default:OpenLength} = await import('../pages/OpenLength/Index')
            return {
                element:<RouteGuard><OpenLength/></RouteGuard>
            }
        }
    },
    {
        path:'/OpenPay',
        lazy:async()=>{
            const {default:OpenPay} = await import('../pages/OpenPay/Index')
            return {
                element:<RouteGuard><OpenPay/></RouteGuard>
            }
        }
    },
    {
        path:'/DoorPay',
        lazy:async()=>{
            const {default:DoorPay} = await import('../pages/DoorPay/Index')
            return {
                element:<RouteGuard><DoorPay/></RouteGuard>
            }
        }
    },
    {
        path:'/PayOk',
        lazy:async()=>{
            const {default:PayOk} = await import('../pages/PayOk/Index')
            return {
                element:<RouteGuard><PayOk/></RouteGuard>
            }
        }
    },
    {
        path:'/Money',
        lazy:async()=>{
            const {default:Money} = await import('../pages/Money/Index')
            return {
                element:<RouteGuard><Money/></RouteGuard>
            }
        }
    },
    {
        path:'/Success',
        lazy:async()=>{
            const {default:Success} = await import('../pages/Success/Index')
            return {
                element:<RouteGuard><Success/></RouteGuard>
            }
        }
    },
    {
        path:'/DaiJI',
        lazy:async()=>{
            const {default:DaiJI} = await import('../pages/DaiJi/Index')
            return {
                element:<RouteGuard><DaiJI/></RouteGuard>
            }
        }
    },
    {
        path:'/Record',
        lazy:async()=>{
            const {default:Record} = await import('../pages/Record/Index')
            return {
                element:<RouteGuard><Record/></RouteGuard>
            }
        }
    },
    {
        path:'/ZhuYuan',
        lazy:async()=>{
            const {default:ZhuYuan} = await import('../pages/ZhuYuan/Index')
            return {
                element:<RouteGuard><ZhuYuan/></RouteGuard>
            }
        }
    },
    {
        path:'/BingLi',
        lazy:async()=>{
            const {default:BingLi} = await import('../pages/BingLi/Index')
            return {
                element:<RouteGuard><BingLi/></RouteGuard>
            }
        }
    },
    {
        path:'/DoorCard',
        lazy:async()=>{
            const {default:DoorCard} = await import('../pages/DoorCard/Index')
            return {
                element:<RouteGuard><DoorCard/></RouteGuard>
            }
        }
    },
    {
        path:'/GetMsg',
        lazy:async()=>{
            const {default:GetMsg} = await import('../pages/GetMsg/Index')
            return {
                element:<RouteGuard><GetMsg/></RouteGuard>
            }
        }
    },
    {
        path:'/WriteMsg',
        lazy:async()=>{
            const {default:WriteMsg} = await import('../pages/WriteMsg/Index')
            return {
                element:<RouteGuard><WriteMsg/></RouteGuard>
            }
        }
    },
    {
        path:'/WriteMsgs',
        lazy:async()=>{
            const {default:WriteMsgs} = await import('../pages/WriteMsgs/Index')
            return {
                element:<RouteGuard><WriteMsgs/></RouteGuard>
            }
        }
    },
    {
        path:'/JiLu',
        lazy:async()=>{
            const {default:JiLu} = await import('../pages/JiLu/Index')
            return {
                element:<RouteGuard><JiLu/></RouteGuard>
            }
        }
    },
    {
        path:'/OrderDet',
        lazy:async()=>{
            const {default:OrderDet} = await import('../pages/OrderDet/Index')
            return {
                element:<RouteGuard><OrderDet/></RouteGuard>
            }
        }
    },
    {
        path:'/XuZhi',
        lazy:async()=>{
            const {default:XuZhi} = await import('../pages/XuZhi/Index')
            return {
                element:<RouteGuard><XuZhi/></RouteGuard>
            }
        }
    },
    {
        path:'/BingAn',
        lazy:async()=>{
            const {default:BingAn} = await import('../pages/BingAn/Index')
            return {
                element:<RouteGuard><BingAn/></RouteGuard>
            }
        }
    }
])
export default router